package dq.study.designmodel.strategy;

/**
 * @author dongqun
 * @Description: 策略模式context
 * @date 2019/4/10 21:29
 */
public class Cat implements Comparable<Cat> {

    private Long height;
    private Long weight;
    private Compartor<Cat> compartor;

    public Cat(Long height, Long weight, Compartor<Cat> compartor) {
        this.height = height;
        this.weight = weight;
        this.compartor = compartor;
    }

    public Long getHeight() {
        return height;
    }

    public Long getWeight() {
        return weight;
    }


    @Override
    public int compare(Cat cat) {
        return compartor.compare(this, cat);
    }

    @Override
    public String toString() {
        return "Cat{" +
                "height=" + height +
                "| weight=" + weight +
                '}';
    }
}
